import { Entity } from "../../core/Entity";

export abstract class SkillEffect {
    constructor(
        protected source: Entity,
        protected targets: Entity[]
    ) {}
    
    public abstract apply(): void;
}

// 伤害效果
export class DamageEffect extends SkillEffect {
    constructor(
        source: Entity,
        targets: Entity[],
        private damage: number
    ) {
        super(source, targets);
    }
    
    public apply(): void {
        this.targets.forEach(target => {
            // target.getComponent(ECAttribute)?.takeDamage(this.damage);
        });
    }
}

// 位移效果
export class MovementEffect extends SkillEffect {
    constructor(
        source: Entity,
        targets: Entity[],
        private distance: number,
        private direction: Vector3
    ) {
        super(source, targets);
    }
    
    public apply(): void {
        this.targets.forEach(target => {
            // 实现位移逻辑
        });
    }
}